package com.dmw.controller;

import com.dmw.dto.Dto;
import com.dmw.service.BaseService;
import com.dmw.util.DtoUtil;
import com.dmw.vo.itemsListVO.SearchCityInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Configuration
public class BaseProviderController {

    @Autowired
    private BaseService baseService;

    /**
     * 商品列表页API 4-1 查询市区API接口
     * @return
     */
    @RequestMapping("/queryCityList")
    public Dto queryCityList(){
        System.out.println(">>>come");

        List<SearchCityInfoVO> list = null;
        try {
            list = baseService.searchCityInfo();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return DtoUtil.returnDataSuccess(list);
    }
}
